﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfChangePassword1.aspx.cs" Inherits="msBsc.WebUi.wMall.Public.wfChangePassword1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>忘记密码</title>
    <link href="/themes/wStyle1/css/sLayout.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/sHead.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/sFoot.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/Public/sForgotPassword.css" rel="stylesheet" />
</head>
<body>
    <div class="wf_all">
        <div id="divLoginInfo">
            <%=msBsc.WebUi.Code.QtHtmlGet.GetHeaderLoginInfo() %>
        </div>
        <div class="password_box">
            <div class="hd">
                <h2 class="hd_title">找回密码</h2>
            </div>
            <div class="password">
                <div class="flowsteps">
                    <ol class="num4">
                        <li class="first done">
                            <span>
                                <i>1</i>
                                <em>输入账户名</em>
                            </span>
                        </li>
                        <li class="done">
                            <span>
                                <i>2</i>
                                <em>验证身份</em>
                            </span>
                        </li>
                        <li class="current">
                            <span>
                                <i>3</i>
                                <em>重置密码</em>
                            </span>
                        </li>
                        <li class="last">
                            <span>
                                <i>4</i>
                                <em>完成</em>
                            </span>
                        </li>
                    </ol>
                </div>
                <div id="change" class="kv_list">
                    <div class="kv_item">
                        <span class="kv_label">密码</span>
                        <input id="J_userpwd_input" class="i_text" type="password" value="" name="accountName">
                    </div>
                    <div class="kv_item">
                        <span class="kv_label">确认密码</span>
                        <input id="J_userOkPwd_input" class="i_text" type="password" value="" name="accountName">
                    </div>
                    <div class="kv_item">
                        <button class="btn" type="button" onclick="changePassword()">下一步 </button>
                    </div>
                </div>
                <div id="complete" class="kv_list" style="display: none;">
                    <div class="kv_item">
                        <h2 style="color: #ff6824; font-size: 16px">重置成功</h2>
                    </div>
                    <div class="kv_item">
                        <div class="email-sent-op">
                            <a class="btn_graylong" target="_self" href="/wp_UserLogin.htm" id="J_GoToEmailWeb">去用新密码登录</a>
                            <div class="email-sent-noreceived">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--start JS引用-->
        <script src="/jqPlugin/js/jquery-1.8.3.min.js"></script>
        <script src="/jqPlugin/js/jBase.js"></script>
        <script src="/jqPlugin/js/jBPage.js"></script>
        <script src="/jqPlugin/js/laytpl.js"></script>
        <script src="/themes/wStyle1/js/comm/VerifyJs.js"></script>
        <script type="text/javascript">
            (function () {
                $("#J_userpwd_input").val("");
                $("#J_userOkPwd_input").val("");
            })();

            function changePassword() {
                var password = $("#J_userpwd_input").val();
                if (!vfcPassword(password)) {
                    return;
                }
                var okPassword = $("#J_userOkPwd_input").val();
                if (!vfcOkPassword(password, okPassword)) {
                    return;
                }
                var opart = new jsonRow();
                opart.AddCell("ACTION", "doChangePassword");
                opart.AddCell("KEY", GetQueryStr("KEY"));
                opart.AddCell("password", password);
                opart.AddCell("okPassword", okPassword);
                ajaxComm(opart);
            }

            function firstNext(index) {
                $(".num4 li").eq(index).removeClass("current");
                $(".num4 li").eq(index).addClass("done");
                $(".num4 li").eq(index + 1).addClass("current");
                $("#J_userpwd_input").val("");
                $("#J_userOkPwd_input").val("");
                $("#change").hide();
                $("#complete").show();
            }

            //验证密码
            function vfcPassword(Password) {
                if (IsNull(Password)) {
                    alert("密码不能为空!");
                    return false;
                }
                if (!isStr(Password)) {
                    alert("密码只能是数字和字母组合!");
                    return false;
                }
                if (!islength(Password, 6, 16)) {
                    alert("密码长度只能在6~16为之间!");
                    return false;
                }
                return true;
            }

            //验证确认密码
            function vfcOkPassword(Password, ComfirPassword) {
                if (IsNull(ComfirPassword)) {
                    alert("确认密码不能为空！");
                    return false;
                }
                if (Password != ComfirPassword) {
                    alert("两次密码不一致!");
                    return false;
                }
                return true;
            }
        </script>
        <!--end JS引用-->
        <%=msBsc.WebUi.Code.QtHtmlGet.GetFloorHtml() %>
    </div>
</body>
</html>
